<template>
  <div style="height: 100%">
    <van-nav-bar
      class="header"
      title="委托单位信息"
      left-text="返回"
      left-arrow
      @click-left="backToCenter"></van-nav-bar>
    <div class="main">
      <van-cell-group>
        <van-field
          v-model="form.fname"
          label="单位名称："
          readonly>
        </van-field>
        <van-field
          v-model="form.fcode"
          label="单位编码："
          readonly>
        </van-field>
        <van-field
          v-model="form.findustryename"
          label="所属行业："
          readonly>
        </van-field>
        <van-field
          v-model="form.fclassidname"
          label="类别名称："
          readonly>
        </van-field>
        <van-field
          v-model="form.fenterprisecode"
          label="企业代码："
          readonly>
        </van-field>
        <van-field
          v-model="form.fprovincename"
          label="省："
          readonly>
        </van-field>
        <van-field
          v-model="form.fcityname"
          label="市："
          readonly>
        </van-field>
        <van-field
          v-model="form.fcountyname"
          label="县："
          readonly>
        </van-field>
        <van-field
          v-model="form.flinkman"
          label="联系人："
          readonly>
        </van-field>
        <van-field
          v-model="form.faddress"
          type="textarea"
          rows="2"
          label="地址："
          readonly>
        </van-field>
      </van-cell-group>
      <van-cell-group title="联系电话">
        <van-field
          v-model="form.flinkmantelephone"
          label="固话："
          readonly>
        </van-field>
        <van-field
          v-model="form.flinkmanphone"
          label="手机："
          readonly>
        </van-field>
      </van-cell-group>
      <van-cell-group title="发票">
        <van-field
          v-model="form.finvoiceclassidname"
          label="发票种类："
          readonly>
        </van-field>
        <van-field
          v-model="form.finvoicemessage"
          label="发票信息："
          clearable
          readonly>
        </van-field>
      </van-cell-group>
      <van-cell-group title="汇款信息">
        <van-field
          v-model="form.fbank"
          label="开户行："
          label-width="100px"
          clearable
          readonly>
        </van-field>
        <van-field
          v-model="form.faccount"
          label="账号："
          label-width="100px"
          clearable
          readonly>
        </van-field>
      </van-cell-group>
      <van-cell-group>
        <van-field
          v-model="form.fmailaddress"
          label="报告邮寄地址："
          label-width="100px"
          readonly>
        </van-field>
        <van-field
          v-model="form.frecipient"
          label="收件人："
          label-width="100px"
          readonly>
        </van-field>
        <van-field
          v-model="form.frecipientphone"
          label="收件人电话："
          label-width="100px"
          readonly>
        </van-field>
        <van-field
          v-model="form.frecipientmail"
          label="报告接收邮箱："
          label-width="100px"
          readonly>
        </van-field>
        <van-field
          v-model="form.fgroupname"
          label="集团公司名称："
          label-width="100px"
          readonly>
        </van-field>
      </van-cell-group>
    </div>
    <footer-btn></footer-btn>
  </div>
</template>

<script>
import Cookies from 'js-cookie'
import {
  NavBar,
  Button,
  Cell,
  CellGroup,
  Field,
  Toast,
  Icon
} from 'vant'
import footerBtn from '@/components/footerBtn'
import { limscustomer_searchlimscustomeridbyuserid } from '@/api/custome'
export default {
  name: 'custome',
  components: {
    footerBtn,
    [NavBar.name]:NavBar,
    [Button.name]:Button,
    [Cell.name]:Cell,
    [CellGroup.name]:CellGroup,
    [Field.name]:Field,
    [Icon.name]:Icon,
  },
  created() {
    this.userid = 'bb5a8fe0-e03e-42ba-a1ed-279bba27b3a3'
    this.getData()
  },
  data() {
    return {
      userid: Cookies.get('fusreid'),
      isregister: false,
      audit: {},
      form: {
        userid: Cookies.get('fusreid'),
        // fid: '', // 主键
        fname: '', // 单位名称
        fcode: '', // 单位编码
        findustry: '', // 所属行业
        findustryename: '', // 所属行业名称
        fclassid: '', // 类别主键
        fclassidname: '', // 类别名称
        // fcustomerid: '', // 客户主键
        // fcustomername: '', // 客户名称
        fenterprisecode: '', // 企业代码（个人填身份证号）
        fprovince: '', // 省
        fprovincename: '',
        fcity: '', // 市
        fcityname: '',
        fcounty: '', // 县
        fcountyname: '',
        flinkman: '', // 联系人
        faddress: '', // 地址
        flinkmantelephone: '', // 联系人固话
        flinkmanphone: '', // 联系人手机
        finvoiceclassid: '', // 开发票信息(发票种类)
        finvoiceclassidname: '',
        finvoicemessage: '', // 开发票信息(发票信息)
        fbank: '', // 汇款信息（开户行)
        faccount: '', // 汇款信息（账号)
        fmailaddress: '', // 报告邮寄地址
        frecipient: '', // 收件人
        frecipientphone: '', // 收件人电话
        frecipientmail: '', // 电子版报告接收邮箱
        fgroupname: '', // 集团公司名称
        // ffullcode: '', // 全编码
        // fstate: '1', // 状态(0=禁用,1=启用)
        fisstate: '0', // 审批状态(0待审批,1审批通过,2待审批)
        fapprovemessage: '', // 审批意见
      },
    }
  },
  methods: {
    getData() {
      limscustomer_searchlimscustomeridbyuserid({
        userid: this.userid
      }).then(res => {
        const data = res.rows[0]
        for (const key in this.form) {
          this.form[key] = data[key]
        }
      })
    },
    backToCenter() {
      history.go(-1)
    },
  }
}
</script>

<style>

</style>